FROM nginx

MAINTAINER MingXiangXue <MingxiangXue@gmail.com>

RUN apt-get update && \
	BUILD_PACKAGES="supervisor php5-fpm php5-mysql php-apc php5-curl php5-gd php5-intl php5-mcrypt php5-memcache php5-sqlite php5-tidy php5-xmlrpc php5-xsl php5-pgsql php5-mongo" && \
	apt-get -y install $BUILD_PACKAGES

# Supervisor Config
ADD ./supervisord.conf /etc/supervisord.conf

# Start Supervisord
ADD ./start.sh /start.sh
RUN chmod 755 /start.sh

RUN rm -f /var/log/nginx/access.log /var/log/nginx/error.log

# Setup Volume
VOLUME ["/etc/nginx", "/usr/share/nginx/html"]

# Expose Ports
EXPOSE 443
EXPOSE 80

CMD ["/bin/bash", "/start.sh"]